package com.yvan.leto.server.domain;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;
import org.joda.time.DateTime;

@Getter
@Setter
@TableName("tb_user")
public class UserAgent {

    public static final short NORMAL = 0;
    public static final short DELETED = 1;
    public static final short DISABLED = 2;

    /**
     * 登录代理的编号
     */
    @JsonProperty("user_agent_id")
    @TableId("user_agent_id")
    private String userAgentId;

    /**
     * 登录代理的登录名
     */
    @JsonProperty("login_name")
    @TableField("login_name")
    private String loginName;

    /**
     * 登录密码，login_type == "password" 时有效
     */
    @JsonProperty("login_password")
    @TableField("login_password")
    private String loginPassword;

    /**
     * 状态 0=正常, 1=删除, 2=停用
     */
    @JsonProperty("status")
    @TableField("status")
    private Short status;

    /**
     * 授权版本,如果被更改，所有登录的会话都会被登出
     */
    @JsonProperty("token_version")
    @TableField("token_version")
    private Long tokenVersion;

    /**
     * 真实姓名
     */
    @JsonProperty("real_name")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField("real_name")
    private String realName;

    /**
     * 邮件
     */
    @JsonProperty("email")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField("email")
    private String email;

    /**
     * 手机
     */
    @JsonProperty("mobile")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @TableField("mobile")
    private String mobile;

    @JsonProperty("create_at")
    @TableField(exist = false)
    private DateTime createAt;
}
